package prj.common.bean;

import java.io.Serializable;
import java.util.Date;

import javax.inject.Named;

import org.springframework.context.annotation.Scope;

@Named("sysdate")
@Scope("application")
public class SystemDate implements Serializable {
	private static final long serialVersionUID = 1L;
	private Date now;

	public Date getNow() {
		if (now == null) {
			now = new Date();
		} else {
			now.setTime(System.currentTimeMillis());
		}
		return now;
	}

	public void setNow(Date now) {
		this.now = now;
	}
}
